package com.mycharx.springboothibernate.controller;

import com.mycharx.springboothibernate.entity.SsoUser;
import com.mycharx.springboothibernate.service.SsoUserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * The type Sso user controller.
 *
 * @author 张卜亢
 * @date 2020.03.27 23:28:20
 */
@Controller
public class SsoUserController {

    @Resource
    private SsoUserService ssoUserService;

    @RequestMapping("/test")
    @ResponseBody
    public Object test() {
        return ssoUserService.findAll();
    }

    @RequestMapping("/save")
    @ResponseBody
    public Object save(SsoUser ssoUser) {
        return ssoUserService.saveOrUpdate(ssoUser);
    }
}
